package com.lb.design.pattern.stratery;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/pay")
public class PaymentController {

    private final PaymentService paymentService;

    public PaymentController(PaymentService paymentService) {
        this.paymentService = paymentService;
    }

    @GetMapping("/{type}/{amount}")
    public String doPay(@PathVariable String type, @PathVariable double amount) {
        paymentService.pay(type, amount);
        return "支付成功";
    }
}
